<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue实例</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
  <div id="app">
    {{title}}
    {{message}}
    {{obj.x}}
    {{el}}
    <div>
      <button @click="handleClick">click</button>
    </div>
  </div>
  <div id="root">
    {{msg}}
  </div>
  <script>
    var xxx = 'aaa'

    const obj = {
      x: 100,
      y: 200
    }

    Object.freeze(obj)

    var app = new Vue({
      el: '#app',
      data: {
        title: 'hello vue',
        message: '',
        obj,
        el: 'div element'
      },
      methods: {
        handleClick() {
          console.log(this.$el)
          console.log(this.el)
        }
      },
    })

    app.message = 'line 1'

    new Vue({
      el: '#root',
      data: {
        msg: 'hi'
      }
    })
  </script>
</body>
</html>